package com.starhub.engine.document.result;

import com.starhub.engine.document.entity.DocumentInfo;
import lombok.Data;

import java.util.List;

@Data
public class DocumentDealListResult {
    private boolean success;
    private String message;
    private List<DocumentInfo> page;
    private long total;

    public static DocumentDealListResult success(List<DocumentInfo> page, long total) {
        DocumentDealListResult result = new DocumentDealListResult();
        result.setPage(page);
        result.setSuccess(true);
        result.setTotal(total);
        return result;
    }

    public static DocumentDealListResult fail(String message) {
        DocumentDealListResult result = new DocumentDealListResult();
        result.setSuccess(false);
        result.setMessage(message);
        return result;
    }
}
